home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993…ch: Other People's Memory / ADC Developer CD (1993-03) (''Other People's Memory'')_iso / Dev.CD Mar 93.iso / Technical Documentation / Sample Code / DTS.Lib & Samples / DTS.Draw / Start.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-10-22  |  1.7 KB  |  73 lines  |  [TEXT/MPS ]

  1. /*
  2. ** Apple Macintosh Developer Technical Support
  3. **
  4. ** File:        Start.c
  5. ** Written by    Eric Soldan
  6. **
  7. ** Copyright © 1989-1992 Apple Computer, Inc.
  8. ** All rights reserved.
  9. */
  10.  
  11.  
  12.  
  13. /*****************************************************************************/
  14.  
  15.  
  16.  
  17. #define declare_main_structs
  18.  
  19. #include "App.h"            /* Get the application includes/typedefs, etc.    */
  20. #include "App.Common.h"        /* Get the stuff in common with rez.            */
  21. #include "App.protos.h"        /* Get the prototypes for the application.        */
  22.  
  23. #ifndef __TOOLUTILS__
  24. #include <ToolUtils.h>
  25. #endif
  26.  
  27.  
  28.  
  29. /*****************************************************************************/
  30.  
  31.  
  32.  
  33. #ifndef THINK_C
  34. extern void _DataInit();
  35. #endif
  36.  
  37.  
  38.  
  39. /*****************************************************************************/
  40. /*****************************************************************************/
  41.  
  42.  
  43.  
  44. #pragma segment Main
  45. void    main(void)
  46. {
  47. #ifndef THINK_C
  48.     UnloadSeg((Ptr)_DataInit);        /* Note that _DataInit can't be in Main! */
  49. #endif
  50.  
  51.     SetApplLimit(GetApplLimit() - 16384);
  52.         /* This decreases the application heap by 16k, which in turn
  53.         ** increases the stack by 16k. */
  54.  
  55.     MaxApplZone();                    /* Expand the heap so code segments load at the top. */
  56.  
  57.     Initialize(1, kMinHeap, kMinSpace, nil, nil);    /* Initialize the program. */
  58.     DoSetResCursor(watchCursor);                    /* Rest of startup may take a while. */
  59.     InitRequiredAppleEvents();
  60.     DoAdjustMenus();
  61.  
  62.     OpenToolPalette();                                /* Create the palette window. */
  63.     OpenClipboard();                                /* Create clipboard document. */
  64.     StartDocuments();                                /* Open (or print) designated documents. */
  65.  
  66.     UnloadSeg((Ptr)Initialize);        /* Initialize can't be in Main! */
  67.     EventLoop();                    /* Call the main event loop. */
  68.     ExitToShell();                    /* Quit the application. */
  69. }
  70.  
  71.  
  72.  
  73.